RAIS  3.2
C:/Projekte/RAIS/common/District.cs
Go to the documentation of this file.
00001 
00028 using System;
00029 using System.Collections.Generic;
00030 using System.Text;
00031 using System.Data;
00032 
00033 namespace RAIS.Common.UserManagement
00034 {
00038         public class District : DBObject
00039         {
00040                 #region Constructors
00041                 public District()
00042                 { }
00043                 public District(IDataRecord record)
00044                 {
00045                         if (record["PK District ID"] is DBNull)
00046                         {
00047                                 this.ID = 0;
00048                                 this.Name = string.Empty;
00049                         }
00050                         else
00051                         {
00052                                 this.ID = (int)record["PK District ID"];
00053                                 this.Name = record["District Name"].ToString();
00054                         }
00055                 }
00056                 #endregion
00057         #region Public methods
00058         public bool RestricitonsConflict(District district)
00059         {
00060             if (district.Name == RAIS.Common.Constants.ALL_DISTRICTS &&
00061                 this.Name != RAIS.Common.Constants.ALL_DISTRICTS)
00062                 return true;
00063             else
00064                 if (this.Name == RAIS.Common.Constants.ALL_DISTRICTS &&
00065                     district.Name != RAIS.Common.Constants.ALL_DISTRICTS)
00066                     return true;
00067                 else
00068                     return false;
00069         }
00070         #endregion
00071     }
00072 }